获取webpack 的 global hash

ExtendedAPIPlugin

1
new webpack.ExtendedAPIPlugin()

Adds useful free vars to the bundle.
__webpack_hash__ The hash of the compilation available as free var.

1
var hash = __webpack_hash__;

https://stackoverflow.com/questions/39082976/how-to-pass-the-build-hash-as-an-environment-variable-in-webpack

https://github.com/webpack/webpack/issues/5337

坚持原创技术分享,您的支持将鼓励我继续创作!